package com.my.zl.console.controller.autocode;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.my.zl.common.dto.ReqDTO;
import com.my.zl.common.dto.ResDTO;
import com.my.zl.common.dto.advancedQuery.PageQueryDTO;
import com.my.zl.console.common.aop.LogAnnotation;
import com.my.zl.console.controller.base.BaseController;
import com.my.zl.console.entity.autocode.ZlKeywordDtl;
import com.my.zl.console.dto.autocode.keywordDtl.ReqKeywordDtlAddDTO;
import com.my.zl.console.dto.autocode.keywordDtl.ReqKeywordDtlDelDTO;
import com.my.zl.console.dto.autocode.keywordDtl.ReqKeywordDtlEditDTO;
import com.my.zl.console.dto.autocode.keywordDtl.ReqKeywordDtlQueryDTO;
import com.my.zl.console.dto.autocode.keywordDtl.ReqKeywordDtlDetailDTO;
import com.my.zl.console.dto.autocode.keywordDtl.ReqKeywordDtlStateDTO;
import com.my.zl.console.dto.autocode.keywordDtl.ResKeywordDtlAddDTO;
import com.my.zl.console.dto.autocode.keywordDtl.ResKeywordDtlDelDTO;
import com.my.zl.console.dto.autocode.keywordDtl.ResKeywordDtlEditDTO;
import com.my.zl.console.dto.autocode.keywordDtl.ResKeywordDtlQueryDTO;
import com.my.zl.console.dto.autocode.keywordDtl.ResKeywordDtlDetailDTO;
import com.my.zl.console.service.autocode.IKeywordDtlService;
import com.my.zl.console.dto.autocode.keywordDtl.ResKeywordDtlStateDTO;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 数据库关键字明细表
 * @author ZL
 */
@Api(value="数据库关键字明细表",tags ="数据库关键字明细表")
@RestController
@RequestMapping("/api/autocode/keywordDtl")
public class KeywordDtlController extends BaseController {

    @Autowired
    private IKeywordDtlService keywordDtlService;
    
    /**
     * 查询
     */
    @ApiOperation(value="数据库关键字明细表-查询")
    @RequestMapping(value="/list", method = RequestMethod.GET)
    public ResDTO<ResKeywordDtlQueryDTO> listKeywordDtl(ReqKeywordDtlQueryDTO reqInfo,PageQueryDTO page) throws Exception{
        ResKeywordDtlQueryDTO data = keywordDtlService.queryKeywordDtlList(reqInfo,page);
        return successDATA(data);
    }
    
   /**
     * 详情
     */
    @ApiOperation(value="数据库关键字明细表-详情")
    @RequestMapping(value="/detail", method = RequestMethod.GET)
    public ResDTO<ResKeywordDtlDetailDTO> detailKeywordDtl(ReqKeywordDtlDetailDTO reqInfo) throws Exception{
        ResKeywordDtlDetailDTO data = keywordDtlService.queryKeywordDtlDetail(reqInfo);
        return successDATA(data);
    }
    
    /**
     * 新增
     */
    @ApiOperation(value="数据库关键字明细表-新增")
    @RequestMapping(value="/add", method = RequestMethod.POST)
    public ResDTO<ResKeywordDtlAddDTO> addKeywordDtl(@RequestBody ReqDTO<ReqKeywordDtlAddDTO> reqInfo) throws Exception{
        ResKeywordDtlAddDTO data = keywordDtlService.insertKeywordDtlInfo(reqInfo);
        return successDATA(data);
    }
    
    /**
     * 编辑
     */
    @ApiOperation(value="数据库关键字明细表-编辑")
    @RequestMapping(value="/edit", method = RequestMethod.POST)
    public ResDTO<ResKeywordDtlEditDTO> editKeywordDtl(@RequestBody ReqDTO<ReqKeywordDtlEditDTO> reqInfo) throws Exception{
        ResKeywordDtlEditDTO data = keywordDtlService.updateKeywordDtlInfo(reqInfo);
        return successDATA(data);
    }
    
    /**
     * 删除
     */
    @ApiOperation(value="数据库关键字明细表-删除")
    @RequestMapping(value="/del", method = RequestMethod.POST)
    public ResDTO<ResKeywordDtlDelDTO> delKeywordDtl(@RequestBody ReqDTO<ReqKeywordDtlDelDTO> reqInfo) throws Exception{
        ResKeywordDtlDelDTO data = keywordDtlService.deleteKeywordDtlInfo(reqInfo);
        return successDATA(data); 
    }
    
    /**
     * 状态更新
     */
    @ApiOperation(value="数据库关键字明细表-状态更新")
    @RequestMapping(value="/state", method = RequestMethod.POST)
    public ResDTO<ResKeywordDtlStateDTO> stateKeywordDtl(@RequestBody ReqDTO<ReqKeywordDtlStateDTO> reqInfo) throws Exception{
        ResKeywordDtlStateDTO data = keywordDtlService.updateKeywordDtlState(reqInfo);
        return successDATA(data); 
    }
    
    
}